package com.my.chapter11;

import java.util.*;

public class practice18 {
    public static void main(String[] args) {
        Map<Integer, Integer> a = new HashMap<>();
        a.put(9, 2);
        a.put(5, 6);
        a.put(4,2);
        SortedMap<Integer, Integer> b = new TreeMap<>(a);
        LinkedHashMap<Integer, Integer> c = new LinkedHashMap<>(b);
        for (Integer e : c.keySet()) {
            System.out.println(e+" "+" "+c.get(e));
        }
    }
}
